
<#include "/common/head.html"/>
 <div class="easyui-panel addPage" data-options="fit:true,border:false,novalidate:true">
    <form class="easyui-form" id="ff" method="post" data-options="novalidate:true">
        <table class="table1">
        	<tr>
           		<th><span>工序名称：</span></th>
               	<td colspan="3">
               		<input class="easyui-textbox" type="text" name="text" value="${model.text!}" data-options="required:true"></input>
           		</td>           		
           	</tr>              
             <tr>
	            <th><span>计划开工时间：</span></th>
	               	<td>
	               		<input class="easyui-datebox" type="text" name="start_date" value="${model.start_date!}" data-options=""></input>
	           		</td>
	       		<th><span>计划完工时间：</span></th>
	           	<td>
	           		<input class="easyui-datebox" type="text" name="end_date" value="${model.end_date!}" data-options=""></input>
	       		</td>             
             </tr>   
             <tr>
	            <th><span>实际开工时间：</span></th>
	               	<td>
	               		<input class="easyui-datebox" type="text" name="real_sdate" value="${model.real_sdate!}" data-options=""></input>
	           		</td>
	       		<th><span>实际完工时间：</span></th>
	           	<td>
	           		<input class="easyui-datebox" type="text" name="real_edate" value="${model.real_edate!}" data-options=""></input>
	       		</td>             
             </tr>                
             <tr>	
           		<th><span>任务图标：</span></th>
               	<td>
	            	<input type="text" name="p_icon"  value="${model.p_icon!}" onclick='top.window.openPopup(this, "请选择图标", "${ctx}/common/iconsPage", {width: 540, height: 400})'></input>
           		</td> 		
           		<th><span>状态：</span></th>
               	<td >
	            	<!-- <input class="easyui-textbox" type="text" name="status" value="${model.status!}" data-options=""></input> -->
           			<select id="cc" class="easyui-combobox" name="status" style="width:135px;">
					    <option value="0">正常进度</option>
					    <option value="1">正偏离</option>
					    <option value="-1">负偏离</option>					  
					</select>
           		</td>            
            </tr>
        </table>
    </form>
</div>
<script>
top.window.subPage.save = save;

function save() {
	if($("#ff").form('enableValidation').form('validate')) {
		$.post("update", getParam(), function(data) {
			top.window.closeWindow();
			top.window.subPage.loadCurrDatagrid();
		});
	}
}
function getParam() {
	var param = {
			"model.text": getInputValue("text"),        	   
       	    "model.start_date": getInputValue("start_date"), 
       	 	"model.end_date": getInputValue("end_date"), 
	       	"model.real_sdate": getInputValue("real_sdate"), 
	       	"model.real_edate": getInputValue("real_edate"), 
	    	"model.p_icon": getInputValue("p_icon"), 
	    	"model.status": getInputValue("status"), 
	       	"model.id": '${model.id}'	    	
	}
	for(key in param) {
		if(!param[key]) {
			delete param[key];
		}
	}
	return param;
}

//扩展js
$(function() {
	$('#cc').combobox('setValue', ${model.status!0});
});
</script>
<#include "/common/foot.html"/>
